<template>
	<view id="app">
		<div class="main-logo">
			<img src="/static/baidu_logo.png"> 
		</div>
		<div class="search-input">
			<u--input 
			placeholder="请粘贴蓝奏网盘链接..." 
			border="surround" 
			v-model="value" 
			class="input" 
			:clearable="true"
			customStyle="border-radius: 0px;height: 31px;">
			</u--input>
			<u--input
			placeholder="请输入密码..." 
			border="surround" 
			v-model="pwd" 
			class="input" 
			:clearable="true"
			customStyle="border-radius: 0px;height: 31px;">
			</u--input>
			<button class="search-btn" @click="downClick()">解析一下</button> 
		</div>
	</view>
</template>


<script>
	var vk = uni.vk;
	export default {
		data() {
			// 页面数据变量
			return {
				value: '',
				pwd: '',
				scrollTop:0,
			}
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},
		// 监听 - 页面每次【加载时】执行(如：前进)
		onLoad(options = {}) {
			vk = uni.vk;
			this.options = options;
			this.init(options);
		},
		// 监听 - 页面【首次渲染完成时】执行。注意如果渲染速度快，会在页面进入动画完成前触发
		onReady(){
			
		},
		// 监听 - 页面每次【显示时】执行(如：前进和返回) (页面每次出现在屏幕上都触发，包括从下级页面点返回露出当前页面)
		onShow() {
			
		},
		// 监听 - 页面每次【隐藏时】执行(如：返回)
		onHide() {
			
		},
		// 监听 - 点击右上角转发时
		onShareAppMessage(options) {
			
		},
		// 函数
		methods: {
			// 解析页面
			downClick() {
				if(!this.value||this.value.indexOf("lanzoum")==-1){
					vk.toast("请输入蓝奏网盘地址");
					return
				}
				uni.navigateTo({
					url: '/pages/down/down?url=' + this.value + '&pwd='+this.pwd
				})
			},
			pageTo(path){
				vk.navigateTo(path);
			}
		},
		// 监听器
		watch:{
			
		},
		// 计算属性
		computed:{
			
		}
	}
</script>
<style lang="scss" scoped>
#app {
    color: #2c3e50;
    width: 600px;
    font-family: Source Sans Pro, Helvetica, sans-serif;
    text-align: center;
    position: absolute;
    top: 35%;
    left: 50%;
    margin-left: -300px;
    margin-top: -100px;
}
.main-logo {
	width: 600px;
	height: 140px;
	position: relative;
}
.main-logo img {
	display: block;
	margin: 0 auto;
	user-select: none;
	cursor: pointer;
}
.search-input {
	height: 45px;
	width: 600px;
	margin: 0 auto;
	margin-top: 10px;
	position: relative;
	display: flex;
}
.search-input input {
	box-sizing: border-box;
	width: 500px;
	height: 45px;
	font-size: 18px;
	float: left;
	padding-left: 10px;
	padding-right: 10px;
	overflow: hidden;
	border-color: #0055ff !important;
}
.search-btn{
    height: 45px;
    width: 100px;
    background-color: #0055ff;
    color: white;
    font-size: 16px;
    font-weight: bold;
    float: left;
    line-height: 45px;
    border-radius: 0;
}
.search-btn {
	cursor: pointer
}
@media(max-width:768px){
#app {
    color: #2c3e50;
    width: 600px;
    font-family: Source Sans Pro, Helvetica, sans-serif;
    text-align: center;
    position: absolute;
    top: 20%;
    left: 50%;
    margin-left: -300px;
    margin-top: -100px;
}
.main-logo {
	width: 600px;
	height: 140px;
	position: relative;
}
.main-logo img {
	display: block;
	margin: 0 auto;
	user-select: none;
	cursor: pointer;
}
.search-input {
	height: 45px;
	width: 350px;
	margin: 0 auto;
	margin-top: 10px;
	position: relative;
	display: flex;
}
.search-input input {
	box-sizing: border-box;
	width: 500px;
	height: 45px;
	font-size: 18px;
	float: left;
	padding-left: 10px;
	padding-right: 10px;
	overflow: hidden;
	border-color: #0055ff !important;
}
.search-btn{
    height: 45px;
    width: 100px;
    background-color: #0055ff;
    color: white;
    font-size: 16px;
    font-weight: bold;
    float: left;
    line-height: 45px;
    border-radius: 0;
}
.search-btn {
	cursor: pointer
}
}
</style>